"""
在线词典：
"""

from socket import *

ADDR=("127.0.0.1",8888)

# 逻辑处理 : 向服务器发起请求
class Handle:     #具体的执行放handle类
    def __init__(self):
        self.server_address = (ADDR)
        self.sock = self.connect()

    def connect(self):
        sock = socket()
        sock.connect( self.server_address )
        return sock


# 与用户交互
class DICTView:
    def __init__(self):
        pass

    def menu_1(self):
        while True:
            print( """
                ==============登录界面=============
                1.登录         2.注册         3.退出
                ==================================
                """ )
            cmd = input( "请输入指令" )
            if cmd == "1":
                self.menu_2()
            elif cmd == "2":
                pass
            elif cmd == "3":
                break
            else:
                print( "请重新输入" )


    def menu_2(self):
        while True:
            print( """
                ==============登录界面=============
                1.查单词       2.历史记录      3.注销
                ==================================
                """ )
            cmd = input( "请输入指令" )
            if cmd == "1":
                pass
            elif cmd == "2":
                pass
            elif cmd == "3":
                break
            else:
                print( "请重新输入" )

    def main(self):
        self.menu_1()

if __name__ == '__main__':
    dict=DICTView()
    dict.main()